package com.example.redisdemo.controller;

import com.example.redisdemo.entity.GoodsEntity;
import com.example.redisdemo.interfacer.UUIDSerial;
import com.example.redisdemo.util.RedisUtils;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.UUID;
import java.util.concurrent.TimeUnit;

/**
 * 测试控制类
 *
 * @author hexinglin
 * @created 2021-08-06 9:24
 **/
@RestController
@RequestMapping("/uuid")
public class UUIDController {
    @Autowired
    private UUIDSerial uuidSerial;
    /**
     *@Description: 设置数据
     *@Param:
     *@return:
     */
    @RequestMapping("get")
    public String get(){

        return uuidSerial.uuid();
    }
    @RequestMapping("test")
    public String test(){
        int a = 1/0;
        return uuidSerial.uuid();
    }

    public static void main(String[] args) {
        GoodsEntity goodsEntity = new GoodsEntity(){
            {
                setId("12454");
                setGoodCode("5445");
            }
        };
        System.out.println(goodsEntity);
    }

}
